<?php

/* 
 * @author Donald Barclay
 * @Published 19 March 2014
 * Domain class for what an appointment is
 */

/*
 * Parameters for an appointment/timeslot
 */
class Appointment{
private $appointmentID;//IDs an appt for DB use
private $clinicianID;//Who is the attending
private $clientID;//Person getting booked for appt
private $appointmentType;//Type of appointent (ie Dentistry)
private $appointmentStartTime;//String value that represents appointment time
private $appointmentEndTime;
private $booked;//Boolean value representing if appointment is booked
private $notes;//Misc Notes

/*
 * Constructor
 */
function _construct($a,$clin,$cli,$type,$st,$et){
    $this -> appointmentID = $a;
    $this -> clinicianID = $clin;
    $this -> clientID = $cli;
    $this -> appointmentType = $type;
    $this -> appointmentStartTime = $st;
    $this -> appointmentEndTime = $et;
    $this -> booked = FALSE; 
}
/*
 * Function for changing boolean to read TRUE as a booked appointment
 * Displays success or failure
 */
function setBooked($id){
    if ($id -> booked == FALSE){
    $id -> booked = TRUE;
    echo 'Appointment booked successfully';
    }
    else echo 'Appointment not booked';
}

function isBooked(){
    if ($this->booked == TRUE) {
        return "Appointment " . appointmentID . " is booked";
    } else {
        return "Appointment " . appointmentID . " is open";
    }
}
function getID(){
    return $this->appointmentID;
}
function getClinician(){
    return $this->clinician;
}
function getClient(){
    return $this->client;
}
function getAppointmentTime(){
    return $this->appointmentTime;
}
function getAppointmentType(){
    return $this->appointmentType;
}
function setClinician($c){
    $this->clinican = $c;
}
function setClient($c){
    $this->client = $c;
}
function setAppointmentTime($t){
    $this->appointmentTime = $t;
}
function setAppointmentType($type){
    $this->appointmentType =$type;
}
} // end class